<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Kriging Library: magnitude_mod Module Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<script src="../mathjax/MathJax.js">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Kriging Library
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Types&#160;List</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Data&#160;Types</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">magnitude_mod Module Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="magnitude_mod" -->
<p><a href="modulemagnitude__mod-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">interface &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interfacemagnitude__mod_1_1magnitude.html">magnitude</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">subroutine&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmagnitude__mod.html#a74ccd0b93b5d7036c523711e68472e49">magnitude_func</a> (ndim, ntot, X, Y, stot, H, theta, gamma, sigma)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Subroutine for computing the optimal magnitude associated with a function-only Kriging model. It is used when the length scale and noise ratio are determined and the magnitude is needed. This code is repeated from the <a href="likelihood_mle_8f90.html">likelihood_mle</a> subroutine. If the magnitude formula changes, both this and <a href="likelihood_mle_8f90.html">likelihood_mle</a> need to be modified.  <a href="#a74ccd0b93b5d7036c523711e68472e49"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">subroutine&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmagnitude__mod.html#a8903a1a7b4718a29d4ce172c07202739">magnitude_grad</a> (ndim, ntot, X, Y, gtot, pts, dims, dY, stot, H, theta, gamma, gammaG, sigma)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Subroutine for computing the optimal magnitude associated with a gradient-enhanced Kriging model. It is used when the length scale and noise ratio are determined and the magnitude is needed. This code is repeated from the <a href="likelihood_mle_8f90.html">likelihood_mle</a> subroutine. If the magnitude formula changes, both this and <a href="likelihood_mle_8f90.html">likelihood_mle</a> need to be modified.  <a href="#a8903a1a7b4718a29d4ce172c07202739"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="magnitude_8f90_source.html#l00012">12</a> of file <a class="el" href="magnitude_8f90_source.html">magnitude.f90</a>.</p>
</div><hr/><h2>Member Function/Subroutine Documentation</h2>
<a class="anchor" id="a74ccd0b93b5d7036c523711e68472e49"></a><!-- doxytag: member="magnitude_mod::magnitude_func" ref="a74ccd0b93b5d7036c523711e68472e49" args="(ndim, ntot, X, Y, stot, H, theta, gamma, sigma)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">subroutine magnitude_mod::magnitude_func </td>
          <td>(</td>
          <td class="paramtype">integer, intent(in)&#160;</td>
          <td class="paramname"><em>ndim</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">integer, intent(in)&#160;</td>
          <td class="paramname"><em>ntot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(ndim,ntot), intent(in)&#160;</td>
          <td class="paramname"><em>X</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(ntot), intent(in)&#160;</td>
          <td class="paramname"><em>Y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">integer, intent(in)&#160;</td>
          <td class="paramname"><em>stot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(stot,ntot), intent(in)&#160;</td>
          <td class="paramname"><em>H</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(ndim), intent(in)&#160;</td>
          <td class="paramname"><em>theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), intent(in)&#160;</td>
          <td class="paramname"><em>gamma</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), intent(out)&#160;</td>
          <td class="paramname"><em>sigma</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Subroutine for computing the optimal magnitude associated with a function-only Kriging model. It is used when the length scale and noise ratio are determined and the magnitude is needed. This code is repeated from the <a href="likelihood_mle_8f90.html">likelihood_mle</a> subroutine. If the magnitude formula changes, both this and <a href="likelihood_mle_8f90.html">likelihood_mle</a> need to be modified. </p>
<p>The optimal magnitude given lenght scales and noise ratio is given as: </p>
<p class="formulaDsp">
\[\sigma^{2} = \frac{(Y-H^{T} \beta)^{T} \hat{K}^{-1} (Y-H^{T} \beta )}{N} \]
</p>
<p> where \(\hat{K}\) is the unit magnitude covariance matrix, the elements of which are given as: </p>
<p class="formulaDsp">
\[ \hat{K}_{i,j} = k(\vec{x}_{i}, \vec{x}_{j},\theta) + \Gamma \delta_{i,j}\]
</p>
<p> This subroutine is NOT used within the <a href="likelihood_mle_8f90.html">likelihood_mle</a> subroutine and is used only when the length scale is known and the magnitude is needed. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Brian Lockwood Department of Mechanical Engineering University of Wyoming </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>May 18, 2012 </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">in)</td><td><b> ndim </b>: The dimension of the problem </td></tr>
    <tr><td class="paramname">in)</td><td><b> ntot </b>: The number of training points </td></tr>
    <tr><td class="paramname">in)</td><td><b> X </b>: Location of the training points (size=[ndimxntot]) </td></tr>
    <tr><td class="paramname">in)</td><td><b>Y </b>: Funcation values for the training points (size=[ntot]) </td></tr>
    <tr><td class="paramname">in)</td><td><b>stot </b>: Number of Terms in the regression </td></tr>
    <tr><td class="paramname">in)</td><td><b>H</b>: The collocation matrix for the regression (size=[stotxntot]) </td></tr>
    <tr><td class="paramname">in)</td><td><b> theta </b>: Length scale in each direction (size=[ndim]) </td></tr>
    <tr><td class="paramname">in)</td><td><b> gamma </b>: Ratio of Noise Magnitude to covariance matrix (added to diagonal of covariance matrix with magnitude of 1) </td></tr>
    <tr><td class="paramname">out)</td><td><b> sigma </b>: Optimal covariance magnitude ( \(\sigma\)) </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="magnitude_8f90_source.html#l00041">41</a> of file <a class="el" href="magnitude_8f90_source.html">magnitude.f90</a>.</p>

</div>
</div>
<a class="anchor" id="a8903a1a7b4718a29d4ce172c07202739"></a><!-- doxytag: member="magnitude_mod::magnitude_grad" ref="a8903a1a7b4718a29d4ce172c07202739" args="(ndim, ntot, X, Y, gtot, pts, dims, dY, stot, H, theta, gamma, gammaG, sigma)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">subroutine magnitude_mod::magnitude_grad </td>
          <td>(</td>
          <td class="paramtype">integer, intent(in)&#160;</td>
          <td class="paramname"><em>ndim</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">integer, intent(in)&#160;</td>
          <td class="paramname"><em>ntot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(ndim,ntot), intent(in)&#160;</td>
          <td class="paramname"><em>X</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(ntot), intent(in)&#160;</td>
          <td class="paramname"><em>Y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">integer, intent(in)&#160;</td>
          <td class="paramname"><em>gtot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">integer, dimension(gtot), intent(in)&#160;</td>
          <td class="paramname"><em>pts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">integer, dimension(gtot), intent(in)&#160;</td>
          <td class="paramname"><em>dims</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(gtot), intent(in)&#160;</td>
          <td class="paramname"><em>dY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">integer, intent(in)&#160;</td>
          <td class="paramname"><em>stot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(stot,ntot+gtot), intent(in)&#160;</td>
          <td class="paramname"><em>H</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), dimension(ndim), intent(in)&#160;</td>
          <td class="paramname"><em>theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), intent(in)&#160;</td>
          <td class="paramname"><em>gamma</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), intent(in)&#160;</td>
          <td class="paramname"><em>gammaG</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real(8), intent(out)&#160;</td>
          <td class="paramname"><em>sigma</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Subroutine for computing the optimal magnitude associated with a gradient-enhanced Kriging model. It is used when the length scale and noise ratio are determined and the magnitude is needed. This code is repeated from the <a href="likelihood_mle_8f90.html">likelihood_mle</a> subroutine. If the magnitude formula changes, both this and <a href="likelihood_mle_8f90.html">likelihood_mle</a> need to be modified. </p>

<p>Definition at line <a class="el" href="magnitude_8f90_source.html#l00126">126</a> of file <a class="el" href="magnitude_8f90_source.html">magnitude.f90</a>.</p>

</div>
</div>
<hr/>The documentation for this module was generated from the following file:<ul>
<li><a class="el" href="magnitude_8f90_source.html">magnitude.f90</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>
Copyright (C) 2012 Brian A. Lockwood <br>
Generated on Tue May 1 2012 17:15:55 for Kriging Library
by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer"
							 src="doxygen.png"
							 alt="doxygen"/></a>
1.7.3
</small></address>
